<?php
include("db/connect.php");

$sqlagree="insert into ordersmaterial(ordersmat_date,ordersmat_status,emp_id) values('".date("Y-m-d")."','000',7)";
$queryagree=mysql_query($sqlagree);
$sqlorder="select ordermat_id from ordersmaterial order by ordermat_id desc";
$queryorder=mysql_query($sqlorder);
$resultorder=mysql_fetch_array($queryorder);
$sqlupdatecart="update cartmaterial set ordermat_id='".$resultorder["ordermat_id"]."' where ordermat_id='0'";
$queryupdatecart=mysql_query($sqlupdatecart);

?>